﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace 会员卡管理系统
{
    public partial class AddNewVip : Form
    {
        public AddNewVip()
        {
            InitializeComponent();
            btnAdd.DialogResult = DialogResult.OK;
            btnCancel.DialogResult = DialogResult.Cancel;
        }
        Vipclass.tb_viphouseinfo tbVip = new Vipclass.tb_viphouseinfo();
        Vipclass.tbVipHouseMenthod vipMenthod = new Vipclass.tbVipHouseMenthod();
        
        
        private void label3_Click(object sender, EventArgs e)
        {

        }

        private void btnAdd_Click(object sender, EventArgs e)
        {
            tbVip.Strvipid = tbxid.Text;
            tbVip.Strvipname = tbxname.Text;
            tbVip.Strvipidcard = tbxidcard.Text;
            if (vipMenthod.tbvipfoadd(tbVip) == 1)
            {
                MessageBox.Show("添加会员"+tbxname.Text+"成功！","提示",MessageBoxButtons.OK,MessageBoxIcon.Information);
                this.Close();
            }
            else
            {
                MessageBox.Show("添加失败","错误",MessageBoxButtons.OK,MessageBoxIcon.Error);
                this.Close();
            }
        }

        private void btnCancel_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        private void AddNewVip_Load(object sender, EventArgs e)
        {

        }
    }
}
